package com.youyun56.commons;

import java.io.File;
import java.io.FileInputStream;

import com.youyun56.PropertyManager;

public class PathConfig {

    public final static String CONF_FOLDER;

    public final static String CONF_FILE_NAME = "gps.properties";
    public static String GPS_FILE_NAME;
    static {
        CONF_FOLDER = System.getProperty("youyun56.home", System.getProperty("user.dir"));
        File gps = new File((GPS_FILE_NAME = CONF_FOLDER + File.separator + CONF_FILE_NAME));
        if (!gps.exists()) {
            throw new RuntimeException(gps.getAbsolutePath() + " not exist!");
        }
        try {
            PropertyManager.getInstance().load(new FileInputStream(gps));
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

}
